<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../print.css" type="text/css" media="print">
<meta content="ColorMath,sandy.math.ColorMath,applyAlpha,calculateLitColour,hex2rgb,hex2rgbn,rgb2hex" name="keywords">
<title>sandy.math.ColorMath</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'ColorMath - Sandy 3.1.2 API Documentation';
				var baseRef = '../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">Sandy 3D Engine, 3.1.2</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../all-classes.html')" href="../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../all-classes.html')" href="../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../index-list.html')" href="../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../index.html?sandy/math/ColorMath.html&amp;sandy/math/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;ColorMath</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class ColorMath"); titleBar_setSubNav(false,false,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">sandy.math</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class ColorMath</td>
</tr>
</table>
<p></p>
  Math functions for colors.
   
  <p></p>
<br>
<hr>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#applyAlpha()">applyAlpha</a>(c:uint, a:Number):uint</div>
<div class="summaryTableDescription">[static]
   Returns the color with altered alpha value.</div>
</td><td class="summaryTableOwnerCol">ColorMath</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#calculateLitColour()">calculateLitColour</a>(col:Number, lightStrength:Number):Number</div>
<div class="summaryTableDescription">[static]
   Calculate the color for a particular lighting strength.</div>
</td><td class="summaryTableOwnerCol">ColorMath</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#hex2rgb()">hex2rgb</a>(hex:Number):Object</div>
<div class="summaryTableDescription">[static]
   Converts a hexadecimal color value to RGB components
   
   </div>
</td><td class="summaryTableOwnerCol">ColorMath</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#hex2rgbn()">hex2rgbn</a>(hex:Number):Object</div>
<div class="summaryTableDescription">[static]
  Converts hexadecimal color value to normalized rgb components ( 0 - 1 ).</div>
</td><td class="summaryTableOwnerCol">ColorMath</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#rgb2hex()">rgb2hex</a>(r:Number, g:Number, b:Number):Number</div>
<div class="summaryTableDescription">[static]
   Converts color component values ( RGB ) to one hexadecimal value.</div>
</td><td class="summaryTableOwnerCol">ColorMath</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="applyAlpha()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">applyAlpha</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public static function applyAlpha(c:uint, a:Number):uint</code><p>
   Returns the color with altered alpha value.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">c</span>:uint</code> &mdash; 32-bit color.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">a</span>:Number</code> &mdash; New alpha ( 0 - 1 ).
      </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>uint</code> &mdash; The hexadecimal value of the altered color.
   </td>
</tr>
</table>
</div>
<a name="calculateLitColour()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">calculateLitColour</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function calculateLitColour(col:Number, lightStrength:Number):Number</code><p>
   Calculate the color for a particular lighting strength.
   </p><p>This converts the supplied pre-multiplied RGB color into HSL then modifies the L according to the light strength. 
   The result is then mapped back into the RGB space.</p>
   <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">col</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">lightStrength</span>:Number</code></td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Number</code></td>
</tr>
</table>
</div>
<a name="hex2rgb()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">hex2rgb</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function hex2rgb(hex:Number):Object</code><p>
   Converts a hexadecimal color value to RGB components
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">hex</span>:Number</code> &mdash; Hexadecimal color.
      </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Object</code> &mdash; The RGB color of the hexadecimal.
   </td>
</tr>
</table>
</div>
<a name="hex2rgbn()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">hex2rgbn</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function hex2rgbn(hex:Number):Object</code><p>
  Converts hexadecimal color value to normalized rgb components ( 0 - 1 ).
  
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">hex</span>:Number</code> &mdash; hexadecimal color value.
  </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Object</code> &mdash; The normalized rgb components ( 0 - 1 ).
  </td>
</tr>
</table>
</div>
<a name="rgb2hex()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">rgb2hex</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function rgb2hex(r:Number, g:Number, b:Number):Number</code><p>
   Converts color component values ( RGB ) to one hexadecimal value.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">r</span>:Number</code> &mdash; Red color ( 0 - 255 ).
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">g</span>:Number</code> &mdash; Green color ( 0 - 255 ).
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">b</span>:Number</code> &mdash; Blue color ( 0 - 255 ).
      </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Number</code> &mdash; The hexadecimal value of the RGB color.
   </td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright">API documentation for Sandy 3D Engine, Ver. 3.1.2</center>
</div>
</body>
</html>
<!--API documentation for Sandy 3D Engine, Ver. 3.1.2-->
